Skip to content

refactor(spa): split DetailPage/ListPage into focused modules (#657)#662

Merged
MartinCastroAlvarez merged 1 commit into
mainfrom
chore/split-detail-list-pages-657
Jun 1, 2026
Merged

refactor(spa): split DetailPage/ListPage into focused modules (#657)#662
MartinCastroAlvarez merged 1 commit into
mainfrom
chore/split-detail-list-pages-657

Conversation

@MartinCastroAlvarez
Copy link
Copy Markdown
Owner

Summary

Behavior-preserving refactor of the two largest SPA page files (#657). Move-and-import only — no runtime behavior, props, hook order, or rendered output changed.

DetailPage.tsx (1100 LOC) defined 9 components inline; ListPage.tsx (886 LOC) carried two pure helpers at the bottom. The inner pieces now live in sibling modules so each file is focused and navigable. The public page components (DetailPage, ListPage) keep their original paths and named exports, so no importer (App.tsx, tests) changed.

What was extracted

apps/web/src/pages/DetailPage.tsxapps/web/src/pages/detail/:

  • DetailValue.tsx
  • FieldsetSection.tsx
  • ObjectActionButton.tsx
  • EditForm.tsx (incl. SaveAction type, EditFormProps, initialValueFor)
  • CustomViewsMenu.tsx
  • DeleteButton.tsx
  • CollapsedEmptyInline.tsx
  • InlineSection.tsx

apps/web/src/pages/ListPage.tsxapps/web/src/pages/list/helpers.ts:

  • capitalize, emptyLabel

Each newly-exported component/helper carries a /** JSDoc; no any; named exports throughout (matches repo style). Every type, prop interface, hook call order, and JSX block was moved verbatim.

Before / after LOC

  • DetailPage.tsx: 1100 → 323
  • ListPage.tsx: 886 → 874

Verification (all green, from frontend/)

  • pnpm lint:js
  • pnpm lint:css
  • pnpm typecheck ✅ (all 13 workspace projects)
  • pnpm test ✅ (222 tests, 31 files)
  • pnpm build ✅ (vite build, 1847 modules)

The passing test + typecheck + build are the proof the refactor preserved behavior.

Notes

No version bump, no release. Untracked examples/*/migrations/*.py left unstaged; build-emitted static assets reverted so only source moves are committed.

Closes #657

🤖 Generated with Claude Code

Behavior-preserving refactor. Move DetailPage's inner components into
one-per-file modules under apps/web/src/pages/detail/ and lift
ListPage's pure helpers into apps/web/src/pages/list/helpers.ts. The
page components keep their original paths and named exports; no runtime
behavior, props, or rendered output changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MartinCastroAlvarez MartinCastroAlvarez merged commit 59598a8 into main Jun 1, 2026
6 checks passed
@MartinCastroAlvarez MartinCastroAlvarez deleted the chore/split-detail-list-pages-657 branch June 1, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tech-debt] Split oversized page components (DetailPage 1100 LOC, ListPage 886 LOC)

2 participants